Skip to main content

Date LibraryDirect link to Date Library

The Date library in DevAssure provides utilities to generate, format, and manipulate date values dynamically during test execution.
It helps automate date-dependent fields such as bookings, due dates, expirations, and API payloads without hardcoding values.


ActionDescription
Date.Get date offset_days days from current date in format date_formatRetrieves a date value relative to the current system date and returns it in a specified format.

You can generate both past and future dates by specifying an offset (in days). The output is a formatted date string that can be reused in subsequent steps.


ArgumentsDirect link to Arguments

NameTypeDescriptionExample
offset_daysIntegerNumber of days to add or subtract from the current date. Use positive values for future dates and negative for past dates.10, -5 , 0
date_formatStringDefines how the resulting date should be formatted. Supports common and custom date patterns.DD/MM/YYYY, MMM DD YYYY, YYYY-MM-DDTHH:mm:ss

Returns:
A string representing the calculated date in the specified format.


ExamplesDirect link to Examples

Basic Date CalculationDirect link to Basic Date Calculation

futureDate = Date.Get date 10 days from current date in format DD/MM/YYYY

Print log futureDate

pastDate = Date.Get date -5 days from current date in format MMM DD YYYY

Print log pastDate

Execution Log:

Date.Get date 10 days from current date in format DD/MM/YYYY
15/11/2025

Date.Get date -5 days from current date in format MMM DD YYYY
Oct 31 2025


ISO Format (Timestamp)Direct link to ISO Format (Timestamp)

isoDate = Date.Get date 0 days from current date in format YYYY-MM-DDTHH:mm:ss

Print log isoDate

Execution Log:

Date.Get date 0 days from current date in format YYYY-MM-DDTHH:mm:ss
2025-11-05T00:00:00